package com.android.questions.util;

import android.annotation.SuppressLint;
import android.app.Activity;

import com.android.base.ui.dialog.DialogLoading;


public class LoginLoadingUtil {

    @SuppressLint("StaticFieldLeak")
    private static DialogLoading dialogLoading = null;

    public static void showLoading(Activity activity, String title) {
        if (dialogLoading != null) {
            dialogLoading.dismiss();
            dialogLoading = null;
        }
        dialogLoading = new DialogLoading(activity);
        dialogLoading.setContent(title);
        dialogLoading.show();
    }

    public static void dismissLoading() {
        if (dialogLoading != null) {
            dialogLoading.dismiss();
            dialogLoading = null;
        }
    }
}
